﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GPSTrackingWebsiteManager.ClassManager
{
    public class SessionManagerPage : Telerik.Web.UI.RadAjaxPage
    {       
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (!User.Identity.IsAuthenticated || Session["SessionManager"] == null)
            {
                System.Web.Security.FormsAuthentication.SignOut();
                Session.Abandon();

                if (Request.Cookies["GUID"] != null)
                    Response.Redirect("../../" + Request.Cookies["Login"].Value + ".aspx?Guid=" + Request.Cookies["GUID"].Value, true);
                else
                    Response.Redirect("../../" + Request.Cookies["Login"].Value + ".aspx", true);


                //Response.Redirect("../../SessionFinished.aspx");
            }                
               
        }
    }
}